//2009/08/28 09:59:21
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class WordAbbreviation
{
public:
    vector <string> getAbbreviations(vector <string> words)
    {
		vector<string> v;
		for(int i=0; i<words.size(); i++)
		{
			for(int j=1; j<=words[i].size(); j++)
			{
				bool flag = true;
				string temp = words[i].substr(0, j);
				for(int k=0; k<words.size(); k++)
				{
					if(k!=i && words[k].size() >=j)
					{
						string str = words[k].substr(0, j);
						if(temp.compare(str) == 0)
						{
							flag = false;
							break;
						}
					}
				}
				if(flag)
				{
					v.push_back(temp);
					break;
				}
			}
		}
		return v;
    }
};
